package com.render3d.ms3d;

import javax.vecmath.*;

public class MS3DJoint {

    public byte                             flags;
    public String                           name;
    public String                           parentName;
    public float                            x;
    public float                            y;
    public float                            z;
    public float                            rotX;
    public float                            rotY;
    public float                            rotZ;
    public short                            numKeyFramesRot;
    public short                            numKeyFramesTrans;
    
    public MS3DKeyFrameRotation             keyRotations[];
    public MS3DKeyFrameTranslation          keyTranslations[];
    
    public Matrix4f                         absoluteMatrix;
    public Matrix4f                         relativeMatrix;
    public Matrix4f                         finalMatrix;
    
    public short                            currentRotationKeyframe;
    public short                            currentTranslationKeyframe;
        
    @Override
    public Object clone() throws CloneNotSupportedException {
    	// TODO Auto-generated method stub
    	MS3DJoint joint = new MS3DJoint();
    	joint.flags = flags;
    	joint.name = new String(name);
    	joint.parentName = new String(parentName);
    	joint.x = x;
    	joint.y = y;
    	joint.z = z;
    	joint.rotX = rotX;
    	joint.rotY = rotY;
    	joint.rotZ = rotZ;
    	joint.numKeyFramesRot = numKeyFramesRot;
    	joint.numKeyFramesTrans = numKeyFramesTrans;
    	joint.keyRotations = keyRotations.clone();
    	joint.keyTranslations = keyTranslations.clone();
    	joint.absoluteMatrix = new Matrix4f(absoluteMatrix);
    	joint.relativeMatrix = new Matrix4f(relativeMatrix);
    	joint.finalMatrix = new Matrix4f(finalMatrix);
    	joint.currentRotationKeyframe = currentRotationKeyframe;
    	joint.currentTranslationKeyframe = currentTranslationKeyframe;
    	return joint;
    }
}
